package github.fafaovo.core.init;

import github.fafaovo.common.guiblock.MyIntArray;
import github.fafaovo.common.guiblock.containers.ExampleBurnMachineContainers;
import github.fafaovo.common.guiblock.containers.ExampleInitialContainers;
import github.fafaovo.deepcapacity;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.common.extensions.IForgeContainerType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class ContainerInit {
    public static final DeferredRegister<ContainerType<?>> CONTAINERS_TYPE = DeferredRegister.create(ForgeRegistries.CONTAINERS, deepcapacity.MOD_ID);


    public static final RegistryObject<ContainerType<ExampleBurnMachineContainers>> BURN_CONTAINERS =
            CONTAINERS_TYPE.register("example_burn_containers",
                    () -> IForgeContainerType.create((int windowId, PlayerInventory inv, PacketBuffer data) ->
                            new ExampleBurnMachineContainers(windowId, inv, data.readBlockPos(),
                                    Minecraft.getInstance().world, new MyIntArray())));


    public static final RegistryObject<ContainerType<ExampleInitialContainers>> INITIAL_CONTAINERS =
            CONTAINERS_TYPE.register("example_initial_containers",
                    () -> IForgeContainerType.create((int windowId, PlayerInventory inv, PacketBuffer data) ->
                            new ExampleInitialContainers(windowId, inv, data.readBlockPos(),
                                    Minecraft.getInstance().world, new MyIntArray())));
}
